<form class="form-horizontal" action="<?php echo url::base(true);?>checkpurchaseorder/returnShowSave" name="form1" onsubmit="return checkForm();" method="post">
    <div class="control-group">
        <label class="control-label">供应商</label>
        <div class="controls">
            <span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
            <input id="search1" type="text" name="supplier_name" value="<?php echo $data['supplier_name'];?>" class="ui-autocomplete-input"  readonly>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">SKU:</label>
        <div class="controls">
            <input type="text" name="sku" value="<?php echo $data['sku'];?>" readonly>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">数量:</label>
        <div class="controls">
            <input type="text" name="return_qty" value="<?php echo $data['return_qty'];?>" readonly>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">收货人:</label>
        <div class="controls">
            <input type="text" name="logistics[contact]" value="<?php echo $supplier['contact'];?>" required>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">电话:</label>
        <div class="controls">
            <input type="text" name="logistics[phone]" value="<?php echo $supplier['phone']?$supplier['phone']:$supplier['mobile'];?>"  required>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">收货地址:</label>
        <div class="controls">
            <input type="text" name="logistics[address]" value="<?php echo $supplier['address'];?>" required>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">物流公司:</label>
        <div class="controls">
            <input type="text" name="logistics[logisticsName]" value="<?php echo $supplier['logisticsName'];?>" required>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">运单号:</label>
        <div class="controls">
            <input type="text" name="logistics[trackNo]" value="<?php echo $supplier['trackNo'];?>" required>
        </div>
    </div>
    <?php
    if($data['status'] == 20) {
    ?>
    <div class="control-group">
        <div class="controls">
            <input type="hidden" name="id" value="<?php echo $data['id'];?>">
            <input type="hidden" name="link" value="<?php echo $link;?>">
            <button class="btn btn-info" type="submit">确定</button>
        </div>
    </div>
    <?php
    }
    ?>
</form>
<script src="<?php echo URL::base() ?>media/layer/layer.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>
<script>
    function checkForm() {
//        if(!/^\d+(\.\d{0,5})?$/.test($('input[name=price]').val())){
//            layer.alert('单价格式不对',{icon:5});
//            return false;
//        }
//        if(!/^\w+?$/.test($('input[name=sku]').val())){
//            layer.alert('Sku格式不对',{icon:5});
//            return false;
//        }
        return true;
    }
</script>